﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.RendererUtils.RendererListDesc
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

#nullable disable
namespace UnityEngine.Rendering.RendererUtils
{
  /// <summary>
  ///   <para>Represents the set of GameObjects that a RendererList contains.</para>
  /// </summary>
  public struct RendererListDesc
  {
    /// <summary>
    ///   <para>The method Unity uses to sort the GameObjects in the RendererList. For more information, see Rendering.SortingCriteria.</para>
    /// </summary>
    public SortingCriteria sortingCriteria;
    /// <summary>
    ///   <para>The renderer configuration for the RendererList. For more information, see Rendering.PerObjectData.</para>
    /// </summary>
    public PerObjectData rendererConfiguration;
    /// <summary>
    ///   <para>The material render queue range to use for the RendererList. For more information, see Rendering.RenderQueueRange.</para>
    /// </summary>
    public RenderQueueRange renderQueueRange;
    /// <summary>
    ///   <para>An optional set of values to override the RendererLists render state. For more information, see Rendering.RenderStateBlock.</para>
    /// </summary>
    public RenderStateBlock? stateBlock;
    /// <summary>
    ///   <para>The material to render the RendererList's GameObjects with. This overrides the material for each GameObject.</para>
    /// </summary>
    public Material overrideMaterial;
    /// <summary>
    ///   <para>Indicates whether to exclude dynamic GameObjects from the RendererList.</para>
    /// </summary>
    public bool excludeObjectMotionVectors;
    /// <summary>
    ///   <para>The rendering layer mask to use for filtering this RendererList.</para>
    /// </summary>
    public int layerMask;
    /// <summary>
    ///   <para>Pass index for the override material.</para>
    /// </summary>
    public int overrideMaterialPassIndex;

    internal CullingResults cullingResult { get; private set; }

    internal Camera camera { get; set; }

    internal ShaderTagId passName { get; private set; }

    internal ShaderTagId[] passNames { get; private set; }

    /// <summary>
    ///   <para>Initializes and returns an instance of RendererListDesc.</para>
    /// </summary>
    /// <param name="passName">The pass name to use for the RendererList.</param>
    /// <param name="cullingResult">The culling result used to create the RendererList.</param>
    /// <param name="camera">The camera Unity uses to determine the current view and sorting properties.</param>
    /// <param name="passNames">The list of passes to use for the RendererList.</param>
    public RendererListDesc(ShaderTagId passName, CullingResults cullingResult, Camera camera)
      : this()
    {
      this.passName = passName;
      this.passNames = (ShaderTagId[]) null;
      this.cullingResult = cullingResult;
      this.camera = camera;
      this.layerMask = -1;
      this.overrideMaterialPassIndex = 0;
    }

    /// <summary>
    ///   <para>Initializes and returns an instance of RendererListDesc.</para>
    /// </summary>
    /// <param name="passName">The pass name to use for the RendererList.</param>
    /// <param name="cullingResult">The culling result used to create the RendererList.</param>
    /// <param name="camera">The camera Unity uses to determine the current view and sorting properties.</param>
    /// <param name="passNames">The list of passes to use for the RendererList.</param>
    public RendererListDesc(ShaderTagId[] passNames, CullingResults cullingResult, Camera camera)
      : this()
    {
      this.passNames = passNames;
      this.passName = ShaderTagId.none;
      this.cullingResult = cullingResult;
      this.camera = camera;
      this.layerMask = -1;
      this.overrideMaterialPassIndex = 0;
    }

    /// <summary>
    ///   <para>Checks whether the RendererListDesc is valid.</para>
    /// </summary>
    /// <returns>
    ///   <para>If the RendererListDesc is valid, this returns true. Otherwise, this returns false.</para>
    /// </returns>
    public bool IsValid()
    {
      return !((Object) this.camera == (Object) null) && (!(this.passName == ShaderTagId.none) || this.passNames != null && this.passNames.Length != 0);
    }
  }
}
